]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Fix touch handling of PopupSubMenuMenuItem
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 16 Oct 2015 16:03:30 +0000 (18:03 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 4 Dec 2015 10:50:13 +0000 (11:50 +0100)
It overrides ::button-release-event in order to implement the
hidden/shown toggling, it must do the same on TOUCH_END, otherwise
menus stay shown on touch.

https://bugzilla.gnome.org/show_bug.cgi?id=756748

js/ui/popupMenu.js

index 05f82b8efdae752ccb128b4416b4477147a21a9c..0090aa3b2e21ffb0a7765e5ad8632d515cab0b9d 100644 (file)
@@ -1146,6 +1146,16 @@ const PopupSubMenuMenuItem = new Lang.Class({
         this.actor.remove_style_pseudo_class ('active');
         this._setOpenState(!this._getOpenState());
         return Clutter.EVENT_PROPAGATE;
+    },
+
+    _onTouchEvent: function(actor, event) {
+        if (event.type() == Clutter.EventType.TOUCH_END) {
+            // Since we override the parent, we need to manage what the parent does
+            // with the active style class
+            this.actor.remove_style_pseudo_class ('active');
+            this._setOpenState(!this._getOpenState());
+        }
+        return Clutter.EVENT_PROPAGATE;
     }
 });